﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AgriculturalMachinery.Models
{
    /// <summary>
    /// 被admin/logined继承的类, 公开三个属性分别代表: 用户管理 信息管理 库存管理
    /// </summary>
    public class AdminViewModel
    {
        /// <summary>
        /// 前台将迭代出所有用户
        /// </summary>
        public IQueryable<Clients> AllClients { get; private set; }

        /// <summary>
        /// 前台将迭代出所有通知
        /// </summary>
        public IQueryable<Notify> AllNotifies { get; private set; }

        /// <summary>
        /// 前台将迭代出所有产品信息
        /// </summary>
        public IQueryable<ProductInfo> AllProducts { get; private set; }

        public AdminViewModel()
        {
            AccountRepository ar = new AccountRepository();
            AllClients = ar.FindAllClients();

            ProductRepository pr = new ProductRepository();
            AllProducts = pr.FindAllProducts();

            NotifyRepository nr = new NotifyRepository();
            AllNotifies = nr.FindAllNotify();
        }
    }
}
